#if !defined(AFX_TICKTABLEGRID_H__20B92169_EDC5_419D_BA52_2DC40BAB86A1__INCLUDED_)
#define AFX_TICKTABLEGRID_H__20B92169_EDC5_419D_BA52_2DC40BAB86A1__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TickTableGrid.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CTickTableGrid window
#include "ugctrl.h"
#include "UGCTRado.h"
#include "UGCTelps.h"
#include "UGCTLabeled.h"
#include "UGCTMarquee.h"
#include "UTEdit.h"
#include "UTMaskedEdit.h"

#define	LABEL_BACK		RGB(100,150,200)
#define SUBLABEL_BACK	RGB(220,200,180)

#define MY_SEPARATOR		10
#define USE_UPPER			1001
#define USE_LOWER			1002
#define USE_PASSWORD		1003
#define USE_CHARLIMIT		1004
#define USE_NUMLIMIT		1005
#define USE_FINISHTEST		1006
#define USE_SETMASK			1007
#define USE_SETCOXMASK		1008
#define USE_SETCOXNUMBER	1009
#define USE_SETCOXCURRENCY	1010

#define FLEXEDIT_ID			320001
#define COXMASK_ID			320002
#define COXNUMBER_ID		320003
#define COXCURRENCY_ID		320004

class CMainOrderPanel;

class CPositionInfo;
class CTickTableGrid : public CUGCtrl
{
// Construction
public:
	CTickTableGrid();
	void SetPositionInfo(CPositionInfo* a_Posi);
	void QuickRedrawCell(int col, long row);

// Attributes
public:
	CMainOrderPanel* m_pMainWnd;

	// font functions
	struct _tagFonts
	{
		int fontIndex;
		CFont font;
		_tagFonts *next;

		_tagFonts()
		{
			fontIndex = -1;
			next = NULL;
		}
	} *m_fontsList;

	CFont * m_defFont;
	CFont * m_smallFont;
	CFont * m_largeFont;

	// additional edit controls
	CUGEdit m_myCUGEdit;

	int oldRow;

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTickTableGrid)
	//***** Over-ridable Notify Functions *****
	virtual void OnSetup();
	virtual void OnCharDown(UINT *vcKey, BOOL processed);
	virtual void OnLClicked(int col, long row, int updn, RECT *rect, POINT *point, int processed);
	virtual int OnEditStart(int col, long row, CWnd **edit);
	//virtual int OnEditVerify(int col, long row, CWnd *edit, UINT *vcKey);
	virtual int OnEditFinish(int col, long row, CWnd *edit, LPCTSTR string, BOOL cancelFlag);
	virtual int OnEditContinue(int oldcol, long oldrow, int* newcol, long* newrow);

	//mouse and key strokes
	virtual void OnDClicked(int col, long row, RECT *rect, POINT *point, BOOL processed);

	virtual void OnKeyDown(UINT *vcKey, BOOL processed);

	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CTickTableGrid();

	// Generated message map functions
protected:
	//{{AFX_MSG(CTickTableGrid)
		// NOTE - the ClassWizard will add and remove member functions here.
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_TICKTABLEGRID_H__20B92169_EDC5_419D_BA52_2DC40BAB86A1__INCLUDED_)
